#include "widget.h"
#include "ui_widget.h"
// #include "mylabel.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton * btn = new QPushButton; //创建按钮
    btn->setText("Hell_Qt");   //在按钮上显示 Hello world
    btn->setParent(this); //将按钮置于窗口上
    //更推荐这种推荐在堆上创建的对象
    // MyLabel* label = new MyLabel(this);
    // label->setText(("hello world"));
    // QLabel label(this);
    // label.setText(("hello world"));
}

Widget::~Widget()
{
    delete ui;
}
